package com.ruoyi.common.config;

import com.huifu.bspay.sdk.opps.core.BasePay;
import com.huifu.bspay.sdk.opps.core.config.MerConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(HfuPayConfig.class)
public class HfuPayConfig {


    private static final String rsaPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmfinLMLob1nAsJBnqJR+fqRHEncwYINAeWm0bcOQUVlZaMLW3vSC6ZKSoKKtkOAEJxyUtkPqJ4xcBWJxopWrQHhu+dWqomfuuVQje/+A2hGyXaJTejEA8YoTM07IdoRzO1t0ziRoqW6EmsNkmwLR5lgmaXqS3mb9VjONaSb6q/Vzndq60J7lhAFtBXwS610fHmOKtn1ZeZnPdXA2l8s5W5FvAFVXL9jmYWZrH8TyWnlA4vt15cLfUSJ9kuxU1Y3h6KPBL13F9f6pFXIKGkqVdx1NusztHAPQROfsNW8f7eMpgKqKs6jcKQn0zpixYIQlGGu+dviocMyAC7sMsV+e4QIDAQAB";

    private static final String rsaPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWR6WAotlOGeJ4MUdSGHUiZBXBnqdbiFfdJ0W7cbOV5vPP3jHu1LntsWohhVlFL/zHFZluW+EjmiVktyBq7j68n31cVAJkiPbBTyebXcYWty3vRkQ7kVoTYac/uOqpMYqaOBDm7oVxsutysX2FgAin/6X60KO0l8oI304SSJbL9HgUs96JS7GkAO9lAJWDR5D9DNvOOxHf281TXSACqBLD6F1pcMOhMYmCoDZc8mXoYZUbDWy4eg8eBLbfZ9dH9KqG/fRT7VROFiSNaLsb6jUZ4IJGOsLw+ZcdB/r3kkIZcdyyHDJGbhF818wZtXjR9KscyNkcfnivUe7LRlRCy9K1AgMBAAECggEAN0txeB1ze6tGixcGuQxKvTa6Up2/0oweWD9FBy1U+Mkb2NZW5Rvctbrb5C2epTh89/vYkqS3+FOVgrNm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IerVEmMT1A9jNEARx6jxbLCxH3R/g5aIvQT8MbQfAHoS+72zU8MsyiaOUWS//5xAUfaHY=";

    private static final String productId = "EDUARK";

    private static final String sysId = "6666000154854867";

    private static final String hfId = "6666000154854867";


    public static MerConfig getMerchantConfig() {
        /** debug 模式，开启后有详细的日志
         */
        BasePay.debug = false;

        /**
         * prodMode 模式，默认为生产模式，false可以使用集成测试环境
         */
        BasePay.prodMode = BasePay.MODE_PROD;

        /**
         * 单商户模式
         */
        MerConfig merConfig = new MerConfig();
        merConfig.setProcutId(productId);
        merConfig.setSysId(sysId);
        merConfig.setRsaPrivateKey(rsaPrivateKey);
        merConfig.setRsaPublicKey(rsaPublicKey);
        merConfig.setHuifuId(hfId);
        return merConfig;
    }

}
